Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create multiple .fixed files for diagnostics with multiple suggestions #244

Merged
merged 3 commits into from
Jul 5, 2024

Conversation

Alexendoo
Copy link
Contributor

Some clippy tests disable rustfix because they produce multiple alternative suggestions e.g. join_absolute_paths. This PR allows there to be a .fixed file per alternative suggestion, in that example join_absolute_paths.1.fixed and join_absolute_paths.2.fixed

There are some lints that produce multiple suggestions that are intended to be combined e.g.

error: this binding can be a slice pattern to avoid indexing
  --> tests/ui/index_refutable_slice/if_let_slice_binding.rs:21:17
   |
LL |     if let Some(slice) = slice {
   |                 ^^^^^
   |
help: try using a slice pattern here
   |
LL |     if let Some([slice_0, ..]) = slice {
   |                 ~~~~~~~~~~~~~
help: and replace the index expressions here
   |
LL |         println!("{}", slice_0);
   |                        ~~~~~~~

These would have to use //@no-rustfix for now, but I think moving them to multipart suggestions is correct in the long run

src/custom_flags/rustfix.rs Outdated Show resolved Hide resolved
@rust-cloud-vms rust-cloud-vms bot force-pushed the rustfix-multiple branch 2 times, most recently from c207448 to 04e61f9 Compare July 5, 2024 02:06
src/per_test_config.rs Outdated Show resolved Hide resolved
@rust-cloud-vms rust-cloud-vms bot force-pushed the rustfix-multiple branch from 04e61f9 to 09ed073 Compare July 5, 2024 14:56
src/custom_flags/rustfix.rs Outdated Show resolved Hide resolved
@rust-cloud-vms rust-cloud-vms bot force-pushed the rustfix-multiple branch from 09ed073 to c97fdd4 Compare July 5, 2024 15:52
@rust-cloud-vms rust-cloud-vms bot force-pushed the rustfix-multiple branch from c97fdd4 to 7ec0bc7 Compare July 5, 2024 17:20
@oli-obk oli-obk merged commit 0f2a567 into oli-obk:main Jul 5, 2024
8 checks passed
@Alexendoo Alexendoo deleted the rustfix-multiple branch July 5, 2024 19:55
bors added a commit to rust-lang/rust-clippy that referenced this pull request Jul 15, 2024
Bump ui_test version

r? `@alexendoo`

the rustfix diff is caused by oli-obk/ui_test#244

This should solve the issues around missing summaries at the end

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants